import { Column, PrimaryGeneratedColumn } from "typeorm";
import { ApiProperty } from "@nestjs/swagger";
import { IsNotEmpty, IsOptional } from "class-validator";

export class CreateMenuDto {
    
    @ApiProperty({ description: "菜单名称", example: "用户管理" })
    @IsNotEmpty({ message: "菜单名称不能为空" })
    menuName: string;
    
    @ApiProperty({ description: "菜单编号", example: "user" })
    @IsNotEmpty({ message: "menuKey不能为空" })
    menuKey: string;
    
    @ApiProperty({ description: "菜单图标", example: "iconfont" })
    @IsOptional()
    menuIcon: string;
    
    @ApiProperty({ description: "路由路径", example: "/user" })
    @IsOptional()
    path: string;
    
    @ApiProperty({ description: "前端路由组件地址", example: "@/views/user/userList" })
    @IsOptional()
    componentPath: string;
    
    @ApiProperty({ description: "菜单类型 1-菜单 2按钮 3跳转外链 4接口权限", example: 1 })
    @IsNotEmpty({ message: "menuType不能为空" })
    menuType: number;
    
    @ApiProperty({ description: "字典排序", example: 0 })
    @IsOptional()
    sort: number;
    
    @ApiProperty({ description: "备注" })
    @IsOptional()
    remark: string;
    
    @ApiProperty({ description: "父亲id", example: -1 })//默认为-1 ，-1就是代表顶级
    @IsOptional()
    parentId: number;
}
